//////////////////////////////////////////////////////////////////
//
// Convoy.cs
//
// Copyright (c) 2012 Dan Pike. All rights reserved
//
// Refer to license.txt for any license restrictions.
// 
using Utilities;
using System.Configuration;

namespace Entities.Archive
{
   public class Convoy : Utilities.ArchiveElement
   {
      public Convoy()
      {
         Properties.Add(name_);
         Properties.Add(hub_);
         Properties.Add(ports_);
         ports = new Ports();
      }

      ////////////////////////////////////////////////////////////////////////
      //
      [ConfigurationProperty("name")]
      public string name
      {
         get { return (string)base[name_]; }
         set { base[name_] = value; }
      }

      [ConfigurationProperty("hub")]
      public string hub
      {
         get { return Global.normalizeName((string)base[hub_], Global.NormalizeType.City); }
         set { base[hub_] = Global.normalizeName(value, Global.NormalizeType.City); }
      }

      ////////////////////////////////////////////////////////////////////////
      //
      [ConfigurationProperty("ports")]
      public Ports ports
      {
         get { return (Ports)base[ports_]; }
         set { base[ports_] = value; }
      }

      ////////////////////////////////////////////////////////////////////////
      //
      private ConfigurationProperty name_ = new ConfigurationProperty("name", typeof(string), string.Empty);
      private ConfigurationProperty hub_ = new ConfigurationProperty("hub", typeof(string), string.Empty);
      private ConfigurationProperty ports_ = new ConfigurationProperty("ports", typeof(Ports), null);
   }
}
